
<%@ page  contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="h" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ page import="limousine.util.*" %>
<script language="JavaScript" type="text/JavaScript" src="app/js/wz_tooltip.js"></script>

<div class="data_form">
    <div class="head_data_form">
    </div>
    <div class="show_form">
        <table width="100%" cellspacing="10" cellpadding="0">
            <tr>
                <td align="right">
                    <form id="form1" name="form1" method="post" action="">
                        <input type="button" name="button" id="button" value="ยกเลิก" onclick="javascript:goUrl('systemsmanagerinit.do');" />
                    </form>
                </td>
            </tr>
        </table>

        <table width="100%" border="0" cellspacing="10" cellpadding="0">
            <tr>
                <td><strong>Systems Maneger</strong></td>
            </tr>
            <tr>
                <td>
                    <fieldset>
                        <legend><strong>แก้ข้อมูล</strong></legend>
                        <table width="100%" border="0" cellspacing="5" cellpadding="0">
                            <tr>
                                <td align="center">
                                    <table class="tableForm">
                                        <tr><td valign="center">
                                                <jsp:include page="sys_msg.jsp" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr><td align="center">
                                    <h:form action="/systemsedit">
                                        <table class="tableForm">
                                            <tr><td class="textFormLabel" align="right" width="40%">ID:</td>
                                                <td align="left" width="60%"><h:text property="id" styleClass="textBox" size="15" readonly="true"/>
                                                </td>
                                            </tr>
                                            <tr><td class="textFormLabel" align="right" width="40%">Name:</td>
                                                <td align="left" width="60%"><h:text property="name" styleClass="textBox" size="25"/>
                                                </td>
                                            </tr>
                                            <tr><td class="textFormLabel" align="right">Detail:</td>
                                                <td align="left"><h:textarea property="detail" styleClass="textBox" cols="20" rows="2"/>
                                                </td>
                                            </tr>
                                            <tr><td class="textFormLabel" align="right">Enable:</td>
                                                <td align="left">
                                                    <h:select property="enable" styleClass="comboEnable" onchange="javascript:onChangeType();">
                                                        <logic:present name="<%=Token.SYSTEMS_ENABLE_LIST%>">
                                                            <logic:iterate id="devs" scope="session" type="limousine.util.SelectItem"
                                                            name="<%=Token.SYSTEMS_ENABLE_LIST%>">
                                                        <option value="<%=devs.getKey()%>"  <%=(devs.getSelect()) ? "selected" : ""%> ><%=devs.getValue()%></option>
                                                    </logic:iterate>
                                                </logic:present>
                                            </h:select>
                                    </td>
                                </tr>
                                <tr height="5"><td class="text" align="center" colspan="2">
                                    </td>
                                </tr>
                                <tr><td class="text" align="center" colspan="2">
                                        <input type="button" value="บันทึก" class="button" onclick="javascription:checkFill(this.form);"/>&nbsp;
                                        <!--input type="reset" value="" class="button" /-->
                                    </td>
                                </tr>
                            </table>
                        </h:form>
                </td>
            </tr>
        </table>
        </fieldset>
        </td>
        </tr>
        </table>

    </div>
    <div class="bottom_data_form">
    </div>
</div>

<script type="text/javascript">
    function checkFill(obj){
        clearWarningMsg();
        clearSystemMsg();
       
        if(!checkTextBoxValue(obj.id,"id"))return;
        if(!checkTextBoxValue(obj.name,"name"))return;
        if(!checkTextBoxValue(obj.detail,"detail"))return;

        if(!checkSelectBoxValue(obj.enable,"enable"))return;
       
        onSubmit(obj);
    }
</script>
